<template>
  <div>
    <!-- 搜索区域 -->
    <van-search
      v-model="value"
      shape="round"
      autofocus
      label
      placeholder="请输入搜索关键词"
      @click="goSearch"
    >
      <template slot="left">
        <van-icon
          @click="back"
          name="arrow-left"
          color="#6D6F79"
          size="25"
          style="margin-right: 10px;"
        />
      </template>

      <template slot="left-icon">
        <span class="iconfont icon-Group-" style="color: #B9B9B9;font-size: 14px;"></span>
      </template>
    </van-search>
  </div>
</template>

<script>
export default {
  data() {
    return {
      value: ""
    };
  },
  methods: {
    back() {
      //返回事件
      window.history.back();
    },
    goSearch() {
      //跳转到搜索页
      this.$router.push({
        name: "search"
      });
    }
  }
};
</script>

<style scoped="scoped">
.header {
  position: fixed;
  top: 0px;
  left: 0px;
  width: 100%;
  height: 40px;
  line-height: 40px;
  background-color: #ffffff;
  border-bottom: 1px solid #eeeeee;
  box-shadow: 0px 1px 4px #eeeeee;
  display: flex;
  justify-content: space-between;
  box-sizing: border-box;
  padding: 0px 20px;
  z-index: 7;
}
</style>
